package com.niiwoo.activity.event.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 改变类型（发标，流标，还款成功）
 * @Author zq
 * @Date 2018/3/23
 */
@Getter
@AllArgsConstructor
public enum UsableCreditChangeTypeEventEnum {

    APPLY(Byte.valueOf("1"), "发标"),
    FLOW(Byte.valueOf("2"), "流标"),
    REPAYMENT(Byte.valueOf("3"), "还款成功");

    private Byte type;

    private String desc;

    public static UsableCreditChangeTypeEventEnum valueOf(Byte code) {
        for (UsableCreditChangeTypeEventEnum typeEventEnum : UsableCreditChangeTypeEventEnum.values()) {
            if (code.byteValue() == typeEventEnum.getType()) {
                return typeEventEnum;
            }
        }
        return null;
    }
}
